<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="https://cdn.bootcss.com/jquery/1.12.2/jquery.min.js"></script>
</head>

<body>
    <style>
        .adblock {
            border: 1px solid #efefef;
            width: 260px;
            position: fixed;
            left: 100px;
            bottom: 100px;
            box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
            color: #333;
            user-select: none;
            transition: all ease 0.1s;
            overflow: hidden;
        }

        .adblock .adhide {
            display: none;
        }

        .adblock .adtitle {
            height: 30px;
            line-height: 30px;
            font-size: 14px;
            text-indent: 5px;
            letter-spacing: 1px;
            padding: 2px;
        }

        .adblock .close {
            display: inline-block;
            height: 30px;
            width: 30px;
            float: right;
            text-align: center;
            cursor: pointer;
            font-size: 14px;
            border-radius: 50%;
            text-indent: 0px;
        }

        .adblock .close:hover {
            background: #ddd;
        }

        .adblock img {
            width: 100%;
            height: 100%;
        }

        .adblock .adlist {
            position: relative;
            width: 260px;
            height: 140px;
        }

        .adblock .item {
            position: absolute;
            width: 100%;
            height: 100%;
        }

        .adblock .item .text {
            display: none;
        }

        .adblock .signdiv {
            position: absolute;
            bottom: 5px;
            left: 0px;
            text-align: center;
            width: 100%;
        }

        .adblock .sign {
            width: 10px;
            height: 4px;
            background: white;
            display: inline-block;
            border-radius: 5px;
        }

        .adblock .sign.active {
            background: red;
            width: 15px;
        }

        .adblock_hide .adtitle {
            display: none;
        }

        .adblock_hide .adlist {
            display: none;
        }

        .adblock_hide .signdiv {
            display: none;
        }

        .adblock_hide .adhide {
            display: block;
        }

        .adblock_hide {
            width: 60px;
            height: 30px;
            font-size: 14px;
            line-height: 30px;
            padding: 0px 10px;
            cursor: pointer;
        }

        .adblock_hide:active {
            background: #efefef;
        }

        .adblock_hide .open {
            display: inline-block;
            float: right;
        }
    </style>
    <!-- 广告定义 -->
    <div class="adblock ">
        <div class="adtitle">
            点击购买
            <span class="close">×</span>
        </div>
        <div class="adhide">
            展开
            <span class="open">》</span>
        </div>
        <div class="adlist">
            <div class="item">
                <a href="#">
                    <img src="http://ad.jnqianle.cn/upload/image/20181212/6368022448638320989676099.jpg" alt="">
                    <div class="text">点击购买红茶</div>
                </a>
            </div>
            <div class="item">
                <a href="#">
                    <img src="http://ad.jnqianle.cn/upload/image/20181212/6368022448638320989676099.jpg" alt="">
                    <div class="text">点击购买红茶</div>
                </a>
            </div>
            <div class="item">
                <a href="#">
                    <img src="http://ad.jnqianle.cn/upload/image/20180815/6366994201292169385215728.jpg" alt="">
                    <div class="text">点击购买红茶</div>
                </a>
            </div>
            <div class="item">
                <a href="#">
                    <img src="http://ad.jnqianle.cn/upload/image/20181212/6368022448638320989676099.jpg" alt="">
                    <div class="text">点击购买红茶</div>
                </a>
            </div>
        </div>
        <div class="signdiv">
            <div class="sign active"></div>
            <div class="sign"></div>
            <div class="sign"></div>
            <div class="sign"></div>
        </div>
    </div>
    <script>
        $(function () {
            var block = $('.adblock');
            //关闭
            $('.adblock .close').click(function () {
                block.addClass('adblock_hide');
            });
            //展开
            $('.adhide').click(function () {
                block.removeClass('adblock_hide');
            });
        });
    </script>
</body>

</html>